#include "BankSystem.hh"
#include "Utils.hh"
#include "4_ShowCustomerMenu.hh"
using namespace BankSystem;


// 访问客户账户
void accessCustomerAccounts(BankSystem::BankSystem& bankSystem) {
    SetConsoleOutputCP(CP_UTF8);
    system("clear");
    std::cout << "===== Access Customer Accounts =====" << std::endl;
    
    std::string name;
    std::cout << "Enter customer name: ";
    std::getline(std::cin, name);
    
    auto customer = bankSystem.getCustomerByName(name);
    if (!customer) {
        std::cout << "Error: Customer not found." << std::endl;
        waitForEnter();
        return;
    }
    
    showCustomerMenu(bankSystem, customer);
}